package com.example.framework.view;

import android.app.Dialog;
import android.content.Context;
import android.view.Window;
import android.view.WindowManager;

import androidx.annotation.NonNull;

/**
 * @author:0.2℃
 * @date： 2022-04-02 16:45
 * @Description ：自定义的一个提示框
 */
public class DialogView extends Dialog {
    public DialogView(@NonNull Context context, int layout, int themeResId, int gravity) {
        super(context, themeResId);
        setContentView(layout);
        Window window = getWindow();
        WindowManager.LayoutParams params = window.getAttributes();
        params.width = WindowManager.LayoutParams.MATCH_PARENT;
        params.height = WindowManager.LayoutParams.WRAP_CONTENT;
        params.gravity = gravity;
        window.setAttributes(params);
    }
}
